// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 修改定时任务 PUT /api/monitor/job */
export async function jobEditUsingPUT(body: API.BaseEntity, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/monitor/job', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增定时任务 POST /api/monitor/job */
export async function jobAddUsingPOST(body: API.BaseEntity, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/monitor/job', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除定时任务 DELETE /api/monitor/job/${param0} */
export async function jobRemoveUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.jobRemoveUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { jobIds: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/monitor/job/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取定时任务详细信息 GET /api/monitor/job/${param0} */
export async function jobGetInfoUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.jobGetInfoUsingGETParams,
  options?: { [key: string]: any },
) {
  const { jobId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/monitor/job/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 定时任务状态修改 PUT /api/monitor/job/changeStatus */
export async function jobChangeStatusUsingPUT(
  body: API.BaseEntity,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/monitor/job/changeStatus', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 导出定时任务列表 POST /api/monitor/job/export */
export async function jobExportUsingPOST(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.jobExportUsingPOSTParams,
  options?: { [key: string]: any },
) {
  return request<any>('/api/monitor/job/export', {
    method: 'POST',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}

/** 查询定时任务列表 GET /api/monitor/job/list */
export async function jobListUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.jobListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.TableDataInfo>('/api/monitor/job/list', {
    method: 'GET',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}

/** 定时任务立即执行一次 PUT /api/monitor/job/run */
export async function jobRunUsingPUT(body: API.BaseEntity, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/monitor/job/run', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
